package com.xiliu.server.modules.website.service.impl;

import java.util.List;
import java.util.Arrays;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.xiliu.server.modules.app.vo.SlideItemVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.xiliu.server.modules.website.mapper.XlSlideItemMapper;
import com.xiliu.server.modules.website.entity.XlSlideItem;
import com.xiliu.server.modules.website.service.IXlSlideItemService;

/**
 * 幻灯片子项表Service业务层处理
 * 
 * @author xiliu
 * @date 2022-12-05
 */
@Service
public class XlSlideItemServiceImpl extends ServiceImpl<XlSlideItemMapper, XlSlideItem> implements IXlSlideItemService {
    @Autowired
    private XlSlideItemMapper xlSlideItemMapper;

    /**
     * 查询幻灯片子项表
     * @param slideItemId 幻灯片子项表主键
     * @return 幻灯片子项表
     */
    @Override
    public XlSlideItem selectXlSlideItemBySlideItemId(String slideItemId) {
        return xlSlideItemMapper.selectXlSlideItemBySlideItemId(slideItemId);
    }

    /**
     * 查询幻灯片子项表列表
     * @param xlSlideItem 幻灯片子项表
     * @return 幻灯片子项表
     */
    @Override
    public List<XlSlideItem> selectXlSlideItemList(XlSlideItem xlSlideItem) {
        return xlSlideItemMapper.selectXlSlideItemList(xlSlideItem);
    }

    /**
     * 新增幻灯片子项表
     * @param xlSlideItem 幻灯片子项表
     * @return 结果
     */
    @Override
    public boolean create(XlSlideItem xlSlideItem) {
        return save(xlSlideItem);
    }

    /**
     * 修改幻灯片子项表
     * @param xlSlideItem 幻灯片子项表
     * @return 结果
     */
    @Override
    public boolean update(XlSlideItem xlSlideItem) {
        return updateById(xlSlideItem);
    }

    /**
     * 批量删除幻灯片子项表
     * @param slideItemIds 需要删除的幻灯片子项表主键
     * @return 结果
     */
    @Override
    public int deleteXlSlideItemBySlideItemIds(String[] slideItemIds) {
        return xlSlideItemMapper.deleteBatchIds(Arrays.asList(slideItemIds));
    }

    /**
     * 删除幻灯片子项表信息
     * @param slideItemId 幻灯片子项表主键
     * @return 结果
     */
    @Override
    public int deleteXlSlideItemBySlideItemId(String slideItemId) {
        return xlSlideItemMapper.deleteById(slideItemId);
    }

    @Override
    public List<SlideItemVo> getSlideItemByPosition(String position) {
        return xlSlideItemMapper.getSlideItemByPosition(position);
    }
}
